<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: diff2</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: diff2</td>
      <td class="subheader-left"><a href="matlab:open diff2">View code for diff2</a></td>
    </tr>
  </table>
<h1>diff2</h1><p><span class="helptopic">First-order difference</span></p><p>
<strong>d</strong> = <span style="color:red">diff2</span>(<strong>v</strong>) is the first-order difference (1xN) of the series data in
vector <strong>v</strong> (1xN) and the first element is zero.

</p>
<p>
<strong>d</strong> = <span style="color:red">diff2</span>(<strong>a</strong>) is the first-order difference (MxN) of the series data in
each row of the matrix <strong>a</strong> (MxN) and the first element in each row is zero.

</p>
<h2>Notes</h2>
<ul>
  <li>Unlike the builtin function DIFF, the result of DIFF2 has the same
number of columns as the input.</li>
</ul>
<h2>See also</h2>
<p>
<a href="diff.html">diff</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>